<template>
	<view>
		<view class="root-btn" :class="{'r-selected' : selected}">
			<image :src="img" mode="" class="bg"></image>
			<view class="tt-c" :class="{'r-selected' : selected}">
				<view class="title">{{title}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"root-btn",
		props: {
			title: {
				type: String,
				default: '标题'
			},
			img:{
				type:String,
				default:''
			},
			selected: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style scoped>
	
	
	.root-btn {
		width: 280px;
		height: 170px;
		box-sizing:border-box;
		
		margin-bottom: 20px;
		font-size:18px;
		font-weight: 500;
		color: #f8b700;
		border: 1px solid #333;
		position: relative;
	}
	
	.root-btn:hover {
		cursor: pointer;
		border: 1px #ffbc00 solid;
	}
	
	.root-btn:active {
		background-color: aquamarine;
	}
	
	.bg {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 1;
	}
	
	.r-selected {
		border: 1px #ffbc00 solid;
		box-shadow: inset 0 0 30px #ffbc00;
	}
	
	.tt-c {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%; 
		display: flex;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		z-index: 2;
	}
	
	.title{
		
		width: 100%;
		height: 45px; 
		display: flex;
		background: rgba(0, 0, 0, 0.8);
		justify-content: center;
		align-items: center;
	}
	
</style>